<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
</head>
<body>
    <div id="app">
        <p>{{age}}</p>
        <button v-on:click="add">点击加1</button>
        <button @click="del">点击减1</button>
    </div>
</body>
</html>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            age : 1
        },
        methods: {
            add: function () {
                this.age++;
            },
            del: function () {
                this.age--;
            }
        }
    })
</script>